#include "jamod_global.h"
#include "jamod_proxyimport.h"

void JAMod_BindExports(void)
{
	trap_Error = (trap_ErrorX)GetProcAddress(proxyCaller, "trap_Error");
	trap_Printf = (trap_PrintfX)GetProcAddress(proxyCaller, "trap_Printf");
	trap_R_RegisterShader = (trap_R_RegisterShaderX)GetProcAddress(proxyCaller, "trap_R_RegisterShader");
	trap_R_RegisterShaderNoMip = (trap_R_RegisterShaderNoMipX)GetProcAddress(proxyCaller, "trap_R_RegisterShaderNoMip");
	trap_S_RegisterSound = (trap_S_RegisterSoundX)GetProcAddress(proxyCaller, "trap_S_RegisterSound");
	trap_S_StartSound = (trap_S_StartSoundX)GetProcAddress(proxyCaller, "trap_S_StartSound");
	trap_Cvar_VariableBuffer = (trap_Cvar_VariableBufferX)GetProcAddress(proxyCaller, "trapped_Cvar_VariableBuffer");
	trap_FS_FOpenFile = (trap_FS_FOpenFileX)GetProcAddress(proxyCaller, "trapped_FS_FOpenFile");
	trap_FS_Read = (trap_FS_ReadX)GetProcAddress(proxyCaller, "trapped_FS_Read");
	trap_FS_FCloseFile = (trap_FS_FCloseFileX)GetProcAddress(proxyCaller, "trapped_FS_FCloseFile");


	CG_Argv = (Argv)GetProcAddress(proxyCaller, "trap_Argv");
	CG_Argv2 = (Argv2)GetProcAddress(proxyCaller, "trap_Argv2");
}

void JAMod_DisplayMOTD(void)
{
	trap_Printf("------------------------------------------\n");
	trap_Printf("    JAMod - Jedi Academy MOD Project      \n");
	trap_Printf("------------------------------------------\n");
	trap_Printf(" ^5v%d, by eezstreet\n", JAMOD_VERSION);
}

__declspec(dllexport) __inline HMODULE jax_getproxydll(void)
{ return proxyCaller; }

__declspec(dllexport) __inline HMODULE jax_getjagamex86(void)
{ return jagamex86; }